package com.vinci.wishDemo.service.impl;

import com.vinci.wishDemo.entity.TbContentAppreciate;
import com.vinci.wishDemo.mapper.TbContentAppreciateMapper;
import com.vinci.wishDemo.service.TbContentAppreciateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 赞赏表 服务实现类
 * </p>
 *
 * @author 郭三木
 * @since 2021-12-10
 */
@Service
public class TbContentAppreciateServiceImpl extends ServiceImpl<TbContentAppreciateMapper, TbContentAppreciate> implements TbContentAppreciateService {
    @Resource
    private TbContentAppreciateMapper appreciateMapper;

    /*
    查询赞赏列表
     */
    @Override
    public List<TbContentAppreciate> queryappreciateList(String createBy, String beginTime, String endTime) {
        List<TbContentAppreciate> tbContentAppreciates = null;
        try {
             tbContentAppreciates = appreciateMapper.queryappreciateList(createBy, beginTime, endTime);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return tbContentAppreciates;
    }

    /*
    下架赞赏
     */
    @Override
    public void delappre(String appreciateId) {
        try {
            appreciateMapper.delappre(appreciateId);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /*
    查询状态
     */
    @Override
    public TbContentAppreciate querystats(String appreciateId) {
        TbContentAppreciate appstats = null;
        try {
            appstats= appreciateMapper.querystats(appreciateId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return appstats;
    }
}
